﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VietTrips.Domain.Interfaces;
using VietTrips.Domain.Models;
using VietTrips.Domain.Repositories;

namespace VietTrips.Domain.Services
{
    public class ActivityManagerService
    {
        private readonly IActivityRepository _activityRepository = null;

        public ActivityManagerService()
        {
            _activityRepository = new ActivityRepository();
        }

        public List<ActivityType> GetTypes(string orderBy)
        {
            return _activityRepository.AllTypes.ToList();
        }

        public List<Activity> GetActivities(string orderBy)
        {
            if (orderBy == "ActivityName_desc")
            {
                return _activityRepository.All.OrderByDescending(m => m.ActivityName).ToList();
            }
            else
            {
                return _activityRepository.All.OrderBy(m => m.ActivityName).ToList();
            }
            
        } 
    }
}
